package com.crm.service.courseregist;

import com.crm.model.entity.courseregist.CourseRegistration;
import com.crm.model.qo.courseregist.AuditRegistListQO;
import com.crm.model.qo.courseregist.CourseRegistListQO;
import com.crm.model.vo.courseregist.AuditCancelVO;
import com.crm.model.vo.courseregist.AuditRegistListVO;
import com.crm.model.vo.courseregist.CourseRegistVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface CourseRegistDbService {


    /**
     * @Description: 添加报名人
     * @Param: [regist]
     * @Return: java.lang.Boolean
     * @Author: lixq-f
     * @Date: 2021/4/26
    **/
    Boolean insert(CourseRegistration regist);


    /**
     * @Description: 更新报名人
     * @Param: [regist]
     * @Return: java.lang.Boolean
     * @Author: lixq-f
     * @Date: 2021/4/26
    **/
    Boolean update(CourseRegistration regist);



    /**
     * @Description: 根据主键获取课程报名人
     * @Param: [id]
     * @Return: com.crm.model.entity.courseregist.CourseRegistration
     * @Author: lixq-f
     * @Date: 2021/4/26
    **/
    CourseRegistVO selectCourseRegById(String id);


    /**
     * @Description: 删除报名人
     * @Param: [id, deleteStatus]
     * @Return: java.lang.Boolean
     * @Author: lixq-f
     * @Date: 2021/4/26
    **/
    Boolean deleteById(String id, short deleteStatus);



    /**
     * @Description: 报名取消操作
     * @Param: [cancelPersonId-取消人id, cancelTm- 取消时间, id - 报名人id]
     * @Return: java.lang.Boolean
     * @Author: lixq-f
     * @Date: 2021/7/16
     **/
    Boolean registCancel(String cancelPersonId,
                         Date cancelTm,
                         String id);



    /**
     * @Description: 根据创建人获取报名列表
     * @Param: [createPelpleId]
     * @Return: java.util.List<com.crm.model.entity.courseregist.CourseRegistration>
     * @Author: lixq-f
     * @Date: 2021/4/26
    **/
    List<CourseRegistration> selectListByCreatePeopleId(String createPelpleId);



    /**
     * @Description: 获取课程报名列表
     * @Param: [accountId, deleteStatus]
     * @Return: java.util.List<com.crm.model.vo.courseregist.CourseRegistVO>
     * @Author: lixq-f
     * @Date: 2021/4/26
    **/
    List<CourseRegistVO> selectCourseRegistList(short deleteStatus, String order, CourseRegistListQO registListQO);



    /**
     * @Description: 保存数据
     * @Param: [registLst]
     * @Return: java.lang.Boolean
     * @Author: lixq-f
     * @Date: 2021/4/26
    **/
    Boolean batchInsert(List<CourseRegistration> registLst);


    /**
     * @Description: 审核取消
     * @Param: [regist]
     * @Return: java.lang.Boolean
     * @Author: lixq-f
     * @Date: 2021/6/9
     **/
    Boolean auditCancel(CourseRegistration regist);



    /**
     * @Description: 根据客户ID、课程ID获取报名人
     * @Param: [customerId, courseId]
     * @Return: com.crm.common.model.DataResponse
     * @Author: lixq-f
     * @Date: 2021/6/10
     **/
    List<CourseRegistration> getRegistByCourseIdAndCustomerId(String customerId, String courseId);


    /**
     * @Description: 根据产品号更新报名状态为报名成功
     * @Param: [registLst]
     * @Return: java.lang.Boolean
     * @Author: lixq-f
     * @Date: 2021/6/11
    **/
    Boolean consumeNoMember(List<String> registLst);


    /**
     * @Description: 根据报名ID修改报名状态、取消类型
     * @Param: [registLst]
     * @Return: java.lang.Boolean
     * @Author: lixq-f
     * @Date: 2021/6/11
    **/
    Boolean updateRegistStatusByRegistIds(List<String> registLst, int registStatus, int cancelType,int isConsume);



    /**
     * @Description: 审核报名列表
     * @Param: [order, registListQO]
     * @Return: java.util.List<com.crm.model.vo.courseregist.AuditRegistListVO>
     * @Author: lixq-f
     * @Date: 2021/7/15
    **/
    List<AuditRegistListVO> selectAuditRegistList(String order, AuditRegistListQO registListQO);
}
